#define  _CRT_SECURE_NO_WARNINGS  1
# include<stdio.h>
# include<string.h>
int main()
{
	char ch1[1000], ch2[1000], ch3[1000], ch4[1000];
	gets(ch1); 
	gets(ch2); 
	gets(ch3);
	if (strcmp(ch1, ch2) > 0)
	{
		strcpy(ch4, ch2);
		strcpy(ch2, ch1);
		strcpy(ch1, ch4);
	}
	if (strcmp(ch1, ch3) > 0)
	{
		strcpy(ch4, ch3);
		strcpy(ch3, ch1);
		strcpy(ch1, ch4);
	}
	if (strcmp(ch2, ch3) > 0)
	{
		strcpy(ch4, ch3);
		strcpy(ch3, ch2);
		strcpy(ch2, ch4);
	}
	puts(ch1);
	puts(ch2);
	puts(ch3);
	return 0;
}